<%= assembly_page_header(@assembly, 'transition') %>

<%= page_title :page_kind     => 'Transition',
               :page_label    => link_to(@assembly.ciName, assembly_path(@assembly)),
               :page_sublabel => "created by #{@assembly.createdBy}" %>

<%= page_info @assembly.ciAttributes.description %>

<% if @profiles.blank? %>
  <% new_button = {:display => icon('star-o', 'New Environment'),
                   :link    => new_assembly_transition_environment_path(@assembly)} %>
<% else %>
  <% new_button = capture do %>
    <div class="btn-group">
      <a class="btn btn-mini dropdown-toggle" data-toggle="dropdown" data-placement='left'>
        <%= icon('star-o', 'New Environment') %> <%= icon('caret-down') %>
      </a>
      <ul class="dropdown-menu pull-right">
        <% @profiles.each do |p| %>
          <li><%= link_to(p.ciName, new_assembly_transition_environment_path(@assembly, :profile_id => p.ciId)) %></li>
        <% end %>
      </ul>
    </div>
  <% end %>
<% end %>
<%= section_panel 'Environments', :width => 'triple', :position => 'left', :menu => [new_button] do %>
  <div id="environment_list">
    <%= render 'environment_list' %>
  </div>
<% end %>
